package cn.net.dpi.shp.model.entity;

import cn.net.dpi.shp.handler.PointTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.locationtech.jts.geom.Point;

import java.io.Serializable;

/**
 * @TableName bxf_ccl
 */
@TableName(value = "bxf_ccl")
@Data
public class BxfCcl implements Serializable {
    /**
     *
     */
    @TableId
    private Integer fid;

    /**
     *
     */
    @TableField(typeHandler = PointTypeHandler.class)
    private Point theGeom;

    /**
     *
     */
    private Long id;

    /**
     *
     */
    private Long laneid;

    /**
     *
     */
    private Long seqnr;

    /**
     *
     */
    private Double x;

    /**
     *
     */
    private Double y;

    /**
     *
     */
    private Long curvature;

    /**
     *
     */
    private Double heading;

    /**
     *
     */
    private Long slope;

    private Long fileId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BxfCcl other = (BxfCcl) that;
        return (this.getFid() == null ? other.getFid() == null : this.getFid().equals(other.getFid()))
                && (this.getTheGeom() == null ? other.getTheGeom() == null : this.getTheGeom().equals(other.getTheGeom()))
                && (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getLaneid() == null ? other.getLaneid() == null : this.getLaneid().equals(other.getLaneid()))
                && (this.getSeqnr() == null ? other.getSeqnr() == null : this.getSeqnr().equals(other.getSeqnr()))
                && (this.getX() == null ? other.getX() == null : this.getX().equals(other.getX()))
                && (this.getY() == null ? other.getY() == null : this.getY().equals(other.getY()))
                && (this.getCurvature() == null ? other.getCurvature() == null : this.getCurvature().equals(other.getCurvature()))
                && (this.getHeading() == null ? other.getHeading() == null : this.getHeading().equals(other.getHeading()))
                && (this.getSlope() == null ? other.getSlope() == null : this.getSlope().equals(other.getSlope()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFid() == null) ? 0 : getFid().hashCode());
        result = prime * result + ((getTheGeom() == null) ? 0 : getTheGeom().hashCode());
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getLaneid() == null) ? 0 : getLaneid().hashCode());
        result = prime * result + ((getSeqnr() == null) ? 0 : getSeqnr().hashCode());
        result = prime * result + ((getX() == null) ? 0 : getX().hashCode());
        result = prime * result + ((getY() == null) ? 0 : getY().hashCode());
        result = prime * result + ((getCurvature() == null) ? 0 : getCurvature().hashCode());
        result = prime * result + ((getHeading() == null) ? 0 : getHeading().hashCode());
        result = prime * result + ((getSlope() == null) ? 0 : getSlope().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", fid=").append(fid);
        sb.append(", theGeom=").append(theGeom);
        sb.append(", id=").append(id);
        sb.append(", laneid=").append(laneid);
        sb.append(", seqnr=").append(seqnr);
        sb.append(", x=").append(x);
        sb.append(", y=").append(y);
        sb.append(", curvature=").append(curvature);
        sb.append(", heading=").append(heading);
        sb.append(", slope=").append(slope);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}